import {
  $post,
  $get
} from '../utils/request'

// 申请企业信息接口
export const APPLY_CLOUD_ACCOUNT_COMPANY = params =>
  $post('/store-platform/yst/companyApply', params)

// 绑定手机接口
export const BIND_CLOUD_ACCOUNT_PHONE = params =>
  $post('/store-platform/yst/bindPhone', null, params)

// 发送短信验证码接口
export const SEND_CLOUD_ACCOUNT_MESSAGE = params =>
  $post('/store-platform/yst/sendVerificationCode', null, params)

// 会员电子协议签约接口
export const SIGN_CLOUD_ACCOUNT = params =>
  $get('/store-platform/yst/signContract', params)

// 个人实名认证接口
export const SET_REAL_NAME = (bizUserId, realName, idCard) =>
  $post(
    `/store-platform/yst/setRealName?bizUserId=${bizUserId}&realName=${realName}&idCard=${idCard}`
  )

// 申请绑定银行卡接口
export const BIND_CLOUD_ACCOUNT_PERSONAL = params =>
  $post('/store-platform/yst/applyBindBankCard', params)

// 获取会员信息接口
export const FIND_CLOUD_ACCOUNT_INFO = shopId =>
  $post('/store-platform/yst/getMemberInfo', null, {
    shopId
  })

// 验证是否绑卡接口
export const FIND_CLOUD_ACCOUNT_CARD_INFO = shopId =>
  $post('/store-platform/yst/verifyBindBankCard', null, {
    shopId
  })

// 查询余额接口
export const FIND_CLOUD_ACCOUNT_BALANCE = shopId =>
  $post('/store-platform/yst/findBalance', null, {
    shopId
  })

// 提现接口
export const CLOUD_ACCOUNT_WITHDRAW = params =>
  $post('/store-platform/withdrawals/withdrawals', params)

// 确认提现接口
// export const CLOUD_ACCOUNT_WITHDRAW_CONFIRM = params =>
//   $post('/store-platform/withdrawals/confirmWithdrawals', params)

// // 重置手机接口
// export const UPDATE_CLOUD_ACCOUNT_PHONE = params =>
//   $post('/store-platform/yst/changeBindPhone', params)

// 重置手机接口
export const UPDATE_CLOUD_ACCOUNT_PHONE = params =>
  $post('/store-platform/cloud/changeBindPhone', params)

// 更改云账户名称
export const UPDATE_CLOUD_ACCOUNT_NAME = params =>
  $post('/store-api/cloud/updateCloudAccountAlias', params)

/** -------------------------------------------------- **/
/** 新云账户 **/
// 获取会员信息
export const YST_FIND_MEMBER_INFO = params =>
  $post('/store-platform/cloud/cloudAccountInfo', params)

// 查询云账户
export const YST_FIND_ACCOUNT_LIST = params =>
  $post('/store-platform/cloud/queryCloudAccount', params)

// 查询余额
export const YST_FIND_ACCOUNT_BALANCE = params =>
  $post('/store-platform/cloud/queryBalance', params)

// 查询绑定银行卡
export const YST_FIND_BIND_CARD = params =>
  $post('/store-platform/cloud/queryBankCard', params)

// 发送短信验证码
export const YST_SEND_SMS_VERIFICATION_CODE = params =>
  $post('/store-platform/cloud/sendVerificationCode', params)

// 确认提现接口
export const CLOUD_ACCOUNT_WITHDRAW_CONFIRM = params =>
  $post('/store-platform/pay/pay', params)

// 李正搞了一个获取IP地址
export const LI_ZHENG_GET_IP = () => $get('/app-api/remote/ip')

// 分页查询提现记录列表接口
export const FIND_PAGE_BY_RELATE_MAN_API = (shopId, pageNo, pageSize) =>
  $post('/store-platform/withdrawals/findPageByRelateManApi', null, {
    shopId,
    pageNo,
    pageSize
  })

// 创建开店缴费支付订单
export const CREATE_OPEN_SHOP_PAY_ORDER = params =>
  $post('/store-api/pay/createOpenShopPayOrder', params)

// 创建开店缴费订单
export const CREATE_OPEN_SHOP_ORDER = params =>
  $post('/store-api/openShop/createOpenShopOrder', params)

// 创建开店发送短信验证码
export const SEND_VERIFICATION_CODE = params =>
  $post('/store-api/cloud/sendVerificationCode', params)

// 创建开店绑定手机
export const BIND_PHONE = params => $post('/store-api/cloud/bindPhone', params)

// 查询店铺模式
export const FIND_SHOP_MODEL_INFO_API = shopId => $get(`/store-platform/shopModel/findShopModelInfoApi?shopId=${shopId}`)
